fix(control-plane): map AgentID in gRPC session event deserialization#1472
fix(control-plane): map AgentID in gRPC session event deserialization#1472markturansky merged 2 commits intoambient-code:mainfrom
Conversation
The gRPC watch event deserializer was missing the AgentID field mapping, causing all sessions received via gRPC to have an empty AgentID. This meant the reconciler set AGENT_ID="" on runner pods and skipped the agent prompt lookup in assembleInitialPrompt, so agent prompts were never included in INITIAL_PROMPT. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Deploy Preview for cheerful-kitten-f556a0 canceled.
|
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Changes
🚥 Pre-merge checks | ✅ 7 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (7 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
4ae91fa to
449c82d
Compare
Table-driven test verifies every proto Session field is correctly mapped to the SDK types.Session struct, including AgentID. Prevents future field omissions from going undetected. Includes standalone session test (no agent_id) to verify optional fields safely deserialize as empty strings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
449c82d to
8fa6a1c
Compare
|
@CodeRabbit recheck |
|
✅ Actions performedReview triggered.
|
Summary
protoSessionToSDK()in the control plane informer was missing theAgentIDfield mappingAgentID, causing:AGENT_ID=""env var on runner podsassembleInitialPrompt()skipping the agent prompt lookupINITIAL_PROMPTOne-line fix: add
AgentID: s.GetAgentId()to the struct literal ininformer.go.Test plan
TestProtoSessionToSDK_AllFieldsMappedcovers all 33 session fields includingAgentIDAgentID: got , want agent-456vteam-stage): podsession-3cx0er4tsqemxkbhjiwyvym2hbb-runnerhadAGENT_ID=(empty) andINITIAL_PROMPT=write a poem(missing agent prompt "you always talk like a caveman")AGENT_IDset andINITIAL_PROMPTincludes agent promptReproduction steps
acpctl create agent --name cave-man --prompt "you always talk like a caveman"acpctl create session --agent-id <id> --prompt "write a poem"oc get pod <pod> -n <ns> -o jsonpath='{.spec.containers[0].env}' | jq '.[] | select(.name == "AGENT_ID" or .name == "INITIAL_PROMPT")'AGENT_ID=,INITIAL_PROMPT=write a poemAGENT_ID=agent-456,INITIAL_PROMPT=you always talk like a caveman\n\nwrite a poemTest output
🤖 Generated with Claude Code